home *** CD-ROM | disk | FTP | other *** search
/ Fritz: All Fritz / All Fritz.zip / All Fritz / FILES / WORDMISC / MICRODOC.LZH / NEWPAGE.CMD < prev    next >
OS/2 REXX Batch file  |  1987-11-02  |  2KB  |  91 lines

  1. ;    NEWPAGE.CMD:    Startup page Loader
  2. ;            for MicroEMACS 3.9d and above
  3. ;            (C)opyright 1987 by Daniel M Lawrence
  4.  
  5. ; Get rid of the last page
  6.     set $discmd FALSE
  7.     write-message [Cleaning]
  8.     run clean
  9.     delete-buffer "[clean]"
  10.  
  11. ; make sure the function key window is up
  12.     set %rcfkeys FALSE
  13.     execute-macro-1
  14.  
  15. ; Write out the page load instructions
  16.     save-window
  17.     1 next-window
  18.     beginning-of-file
  19.     set $curcol 25
  20.     overwrite-string "           Available Pages to Load:                 "
  21.     next-line
  22.     set $curcol 25
  23.     overwrite-string "    [W]  WORDprocessing                             "
  24.     next-line
  25.     set $curcol 25
  26.     overwrite-string "    [P]  PROGramming                                "
  27.     next-line
  28.     set $curcol 18
  29.     overwrite-string "    "
  30.     set $curcol 25
  31.     overwrite-string "    [B]  BOX/block editing                          "
  32.     next-line
  33.     set $curcol 25
  34.     overwrite-string "[space]  to load a user page                        "
  35.     unmark-buffer
  36.     beginning-of-file
  37.     !force restore-window
  38.     update-screen
  39.  
  40. ; prompt for the page
  41.  
  42.     write-message "Page to load: "
  43. *prompt
  44.     set %rctmp >key
  45.     clear-message-line
  46.     
  47. ; check for an abort
  48.     !if &seq %rctmp ""
  49.         write-message "[Aborted]"
  50.         save-window
  51.         1 next-window
  52.         beginning-of-file
  53.         set $curcol 25
  54.         overwrite-string "   MicroEMACS:  Text Editor                         "
  55.         next-line
  56.         set $curcol 25
  57.         overwrite-string "                                                    "
  58.         next-line
  59.         set $curcol 25
  60.         overwrite-string "  Available function key Pages include:             "
  61.         next-line
  62.         set $curcol 25
  63.         overwrite-string "    WORD  PROG  BOX                                 "
  64.         next-line
  65.         set $curcol 25
  66.         overwrite-string "  [use the f8 key to load Pages]                    "
  67.         unmark-buffer
  68.         beginning-of-file
  69.         !force restore-window
  70.         set $discmd TRUE
  71.         !return
  72.     !endif
  73.     
  74. ; if it is an unlisted page, get it's name
  75.     !if &seq %rctmp " "
  76.         set %rcfile &cat @"Name of Page to load: " ".cmd"
  77.     !else
  78.         set %rcfile &cat %rctmp "page.cmd"
  79.     !endif
  80.  
  81. ; see if this is a legit file
  82.     !if &seq &find %rcfile ""
  83.         write-message "%No Such Page, Page to load: "
  84.         !goto prompt
  85.     !endif
  86.  
  87. ;and lastly, execute it
  88.  
  89.     execute-file %rcfile
  90.     set $discmd TRUE
  91.